﻿@model TGIApp.Model.TicketType
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>TicketType</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Type)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Type)
            @Html.ValidationMessageFor(model => model.Type)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Price)
            @Html.ValidationMessageFor(model => model.Price)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.TotalQuantity)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TotalQuantity)
            @Html.ValidationMessageFor(model => model.TotalQuantity)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.EventDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EventDate)
            @Html.ValidationMessageFor(model => model.EventDate)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Status)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Status)
            @Html.ValidationMessageFor(model => model.Status)
        </div>
         @{ if (Model != null && Model.EventVenue != null)
           { 
            <div >
                @Html.HiddenFor(model => model.EventVenue.Id)
            </div>
           }
          
        }
        <div class="editor-label">
            @Html.LabelFor(model => model.EventVenue.Event)
        </div>
        @{ if (Model != null && Model.EventVenue != null && Model.EventVenue.Event != null)
           { 
            <div class="editor-field">
                @Html.DropDownListFor(model => model.EventVenue.Event.Id, new SelectList(ViewBag.Events, "Id", "Name", Model.EventVenue.Event.Id))
            </div>
           }
           else
           { 
            <div class="editor-field">
                @Html.DropDownListFor(model => model.EventVenue.Event.Id, new SelectList(ViewBag.Events, "Id", "Name"))
            </div>
           }
        }
        <div class="editor-label">
            @Html.LabelFor(model => model.EventVenue.Venue)
        </div>
        @{ if (Model != null && Model.EventVenue != null && Model.EventVenue.Venue != null)
           { 
            <div class="editor-field">
                @Html.DropDownListFor(model => model.EventVenue.Venue.Id, new SelectList(ViewBag.Venues, "Id", "Name", Model.EventVenue.Venue.Id))
            </div>
           }
           else
           { 
            <div class="editor-field">
                @Html.DropDownListFor(model => model.EventVenue.Venue.Id, new SelectList(ViewBag.Venues, "Id", "Name"))
            </div>
           }
        }
        <div class="display-field">
            @Html.LabelFor(model => model.TicketTemplate)
        </div>
        @{ if (Model != null && Model.TicketTemplate != null)
           { 
               
            <div class="editor-field">
                @Html.DropDownListFor(model => model.TicketTemplate.Id, new SelectList(ViewBag.Templates, "Id", "Name", Model.TicketTemplate.Id))
            </div>
           
           }
           else
           { 
            <div class="editor-field">
                @Html.DropDownListFor(model => model.TicketTemplate.Id, new SelectList(ViewBag.Templates, "Id", "Name"))
            </div>
           }
        }
        <div class="editor-label">
            @Html.LabelFor(model => model.CustomTemplate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CustomTemplate)
            @Html.ValidationMessageFor(model => model.CustomTemplate)
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
